package com.wxh.controller;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: HelloController
 * @Description:
 * @Author wxh
 * @Date: 2019/8/14 9:28
 * @Version V1.0.0
 * @Since 1.8
 */
@RestController
@RequestMapping(value = "/hello")
public class HelloController {

    private static final Logger log = LoggerFactory.getLogger(HelloController.class);
    /**
     *  返回字符串
     * @return String
     */
    @PostMapping (value = "/index")
    @ApiOperation(value = "swagger2测试",notes = "测试接口", httpMethod = "POST")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "userName", value="用户姓名", dataType = "string", required = true,paramType = "form"),
            @ApiImplicitParam(name = "userId", value="用户Id", dataType = "string", required = true,paramType = "form")
    })
    public String index(String userName, String userId){
        log.info("参数：{},{}",userName, userId);
        return "Hello Spring Boot";
    }

}
